package com.gly091020.util;

import net.minecraft.text.Text;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class EnglishFightQuestion {
    public String title = "";
    public List<String> items;
    public Integer rightIndex = -1;

    @SuppressWarnings("unchecked")
    public void setData(Map<String, Object> data){
        title = (String) data.get("title");
        items = (List<String>) data.get("items");
        rightIndex = (Integer) data.get("right");
    }

    public Integer getRightIndex() {
        return rightIndex;
    }

    public List<Text> getItems() {
        List<Text> l1 = new ArrayList<>();
        for(String s: items){
            l1.add(Text.of(s));
        }
        return l1;
    }

    public String getTitle() {
        return title;
    }
}
